package com.woniu.zsd.user.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssConfig {

    @Value("${aliyun.oss.host}") // 修改为 host
    private String endpoint;

    @Value("${aliyun.oss.accessKey}") // 修改为 accessKey
    private String accessKeyId;

    @Value("${aliyun.oss.accessSecret}") // 修改为 accessSecret
    private String accessKeySecret;

    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }
}

     